package ueg.org.trabalho.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@Entity
@DiscriminatorValue("FUNCIONARIO")
public class Funcionario extends Pessoa {

    private static final long serialVersionUID = 1L;
    @Column(nullable = false, length = 50, unique = true)
    private String matricula;
    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(schema = "svn")
    @Cascade(value = {CascadeType.ALL})
    private List<Departamento> departamento;

    public String getMatricula() {
        return matricula;
    }

    public void setMatricula(String matricula) {
        this.matricula = matricula;
    }
}
